﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            var r= new Random();
            int inpericia=r.Next(1,7)+6;
            int inforca=r.Next(2,13)+12;
            int insorte=r.Next(1,7)+6;
            mskillbox.Text = inpericia.ToString(); mstaminabox.Text = inforca.ToString(); mluckbox.Text = insorte.ToString();
            eskillbox.Text = "7"; estaminabox.Text = "7";
           
        }

        private void Rectangle_MouseDown(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        private void ScrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {

        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
             int n1;
            bool ismyskill = int.TryParse(mskillbox.Text, out n1);
            if (ismyskill == true)
            { Application.Current.Properties["pericia"] = mskillbox.Text; }
            else { Application.Current.Properties["pericia"] = 10; }
            bool ismystamina = int.TryParse(mstaminabox.Text, out n1);
            if (ismystamina == true)
            { Application.Current.Properties["forca"] = mstaminabox.Text; }
            else { Application.Current.Properties["forca"] = 20; }
            bool isenemyskill = int.TryParse(eskillbox.Text, out n1);
            if (isenemyskill == true)
            { Application.Current.Properties["epericia"] = eskillbox.Text; }
            else {Application.Current.Properties["epericia"] = 7;}
            bool isenemystamina=int.TryParse(estaminabox.Text, out n1);
            if (isenemystamina == true)
            { Application.Current.Properties["eforca"] = estaminabox.Text; }
            else { Application.Current.Properties["eforca"] = 7; }
            bool ismyluck = int.TryParse(mluckbox.Text, out n1);
            if (ismyluck == true)
            { Application.Current.Properties["sorte"] = mluckbox.Text; }
            else { Application.Current.Properties["sorte"] = 9; }
            var Nova = new Page1();
            this.Content = Nova;

        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
}
